<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Livox SDK API: sdk_core/include/third_party/spdlog/spdlog/fmt/bin_to_hex.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="1.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Livox SDK API
   &#160;<span id="projectnumber">V2.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('bin__to__hex_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">bin_to_hex.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="bin__to__hex_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// Copyright(c) 2015 Gabi Melman.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Distributed under the MIT License (http://opensource.org/licenses/MIT)</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Support for logging binary data as hex</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// format flags:</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// {:X} - print in uppercase.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// {:s} - don&#39;t separate each byte with space.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// {:p} - don&#39;t print the position on each line start.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// {:n} - don&#39;t split the output to lines.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// Examples:</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">// std::vector&lt;char&gt; v(200, 0x0b);</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">// logger-&gt;info(&quot;Some buffer {}&quot;, spdlog::to_hex(v));</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// char buf[128];</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">// logger-&gt;info(&quot;Some buffer {:X}&quot;, spdlog::to_hex(std::begin(buf), std::end(buf)));</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacespdlog.html">spdlog</a> {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span>details {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> It&gt;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classspdlog_1_1details_1_1bytes__range.html">   28</a></span>&#160;<span class="keyword">class </span><a class="code" href="classspdlog_1_1details_1_1bytes__range.html">bytes_range</a></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classspdlog_1_1details_1_1bytes__range.html#aa623616735396b0422737b9b62bdd46e">   31</a></span>&#160;    <a class="code" href="classspdlog_1_1details_1_1bytes__range.html#aa623616735396b0422737b9b62bdd46e">bytes_range</a>(It range_begin, It range_end)</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        : begin_(range_begin)</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        , end_(range_end)</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    {</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    }</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classspdlog_1_1details_1_1bytes__range.html#a45b2db8943b9034c5f56838c482a740a">   37</a></span>&#160;    It <a class="code" href="classspdlog_1_1details_1_1bytes__range.html#a45b2db8943b9034c5f56838c482a740a">begin</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        <span class="keywordflow">return</span> begin_;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    }</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classspdlog_1_1details_1_1bytes__range.html#ae46a29852238e3cd2a22b85e2dc1f5d0">   41</a></span>&#160;    It <a class="code" href="classspdlog_1_1details_1_1bytes__range.html#ae46a29852238e3cd2a22b85e2dc1f5d0">end</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordflow">return</span> end_;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    }</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    It begin_, end_;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;};</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;} <span class="comment">// namespace details</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">// create a bytes_range that wraps the given container</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Container&gt;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="namespacespdlog.html#acd3f4323bb627945b4cecbbbc62770ef">   53</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classspdlog_1_1details_1_1bytes__range.html">details::bytes_range&lt;typename Container::const_iterator&gt;</a> <a class="code" href="namespacespdlog.html#acd3f4323bb627945b4cecbbbc62770ef">to_hex</a>(<span class="keyword">const</span> Container &amp;container)</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;{</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    static_assert(<span class="keyword">sizeof</span>(<span class="keyword">typename</span> Container::value_type) == 1, <span class="stringliteral">&quot;sizeof(Container::value_type) != 1&quot;</span>);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">using</span> Iter = <span class="keyword">typename</span> Container::const_iterator;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classspdlog_1_1details_1_1bytes__range.html">details::bytes_range&lt;Iter&gt;</a>(<a class="code" href="namespacefmt_1_1v5_1_1internal.html#ae3eb46c4e73a862893cc2f99a58938a4">std::begin</a>(container), <a class="code" href="namespacefmt_1_1v5_1_1internal.html#a1f190af8f5561392e03519562384d3b8">std::end</a>(container));</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">// create bytes_range from ranges</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> It&gt;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="namespacespdlog.html#a3730108d5b1a43b30f8ddf32404b9d25">   62</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classspdlog_1_1details_1_1bytes__range.html">details::bytes_range&lt;It&gt;</a> <a class="code" href="namespacespdlog.html#acd3f4323bb627945b4cecbbbc62770ef">to_hex</a>(<span class="keyword">const</span> It range_begin, <span class="keyword">const</span> It range_end)</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classspdlog_1_1details_1_1bytes__range.html">details::bytes_range&lt;It&gt;</a>(range_begin, range_end);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;} <span class="comment">// namespace spdlog</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="namespacefmt.html">   69</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacefmt.html">fmt</a> {</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html">   72</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfmt_1_1v5_1_1formatter.html">formatter</a>&lt;<a class="code" href="namespacespdlog.html">spdlog</a>::details::bytes_range&lt;T&gt;&gt;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;{</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#aae6b62746bc315b2927199438ba2f87a">   74</a></span>&#160;    <span class="keyword">const</span> std::size_t line_size = 100;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ae269e1463930629ea37d0d93d0d726c5">   75</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> delimiter = <span class="charliteral">&#39; &#39;</span>;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a6f28abac88c19077023abaadd2d3315f">   77</a></span>&#160;    <span class="keywordtype">bool</span> put_newlines = <span class="keyword">true</span>;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#aec694b471eae3bc7d0a1d4487579721c">   78</a></span>&#160;    <span class="keywordtype">bool</span> put_delimiters = <span class="keyword">true</span>;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a0974264e6edcc83c7c191f34d2ce4781">   79</a></span>&#160;    <span class="keywordtype">bool</span> use_uppercase = <span class="keyword">false</span>;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a0997eb476f830eb211f3d17777079d7d">   80</a></span>&#160;    <span class="keywordtype">bool</span> put_positions = <span class="keyword">true</span>; <span class="comment">// position on start of each line</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="comment">// parse the format string flags</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> ParseContext&gt;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ada366ec2d0f00fa94560551fdbbbb640">   84</a></span>&#160;    <span class="keyword">auto</span> <a class="code" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ada366ec2d0f00fa94560551fdbbbb640">parse</a>(ParseContext &amp;ctx) -&gt; decltype(ctx.begin())</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    {</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="keyword">auto</span> it = ctx.begin();</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">while</span> (*it &amp;&amp; *it != <span class="charliteral">&#39;}&#39;</span>)</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        {</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            <span class="keywordflow">switch</span> (*it)</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            <span class="keywordflow">case</span> <span class="charliteral">&#39;X&#39;</span>:</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                use_uppercase = <span class="keyword">true</span>;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            <span class="keywordflow">case</span> <span class="charliteral">&#39;s&#39;</span>:</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                put_delimiters = <span class="keyword">false</span>;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            <span class="keywordflow">case</span> <span class="charliteral">&#39;p&#39;</span>:</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                put_positions = <span class="keyword">false</span>;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            <span class="keywordflow">case</span> <span class="charliteral">&#39;n&#39;</span>:</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                put_newlines = <span class="keyword">false</span>;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            }</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            ++it;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        }</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">return</span> it;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// format the given bytes range as hex</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> FormatContext, <span class="keyword">typename</span> Container&gt;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a23665231993cdeb323a86ecb9a7a63a1">  112</a></span>&#160;    <span class="keyword">auto</span> <a class="code" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a23665231993cdeb323a86ecb9a7a63a1">format</a>(<span class="keyword">const</span> <a class="code" href="classspdlog_1_1details_1_1bytes__range.html">spdlog::details::bytes_range&lt;Container&gt;</a> &amp;the_range, FormatContext &amp;ctx) -&gt; decltype(ctx.out())</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <a class="code" href="common_8h.html#a8747e6feba8bf2d3f204cb76bfd4607a">SPDLOG_CONSTEXPR</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *hex_upper = <span class="stringliteral">&quot;0123456789ABCDEF&quot;</span>;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <a class="code" href="common_8h.html#a8747e6feba8bf2d3f204cb76bfd4607a">SPDLOG_CONSTEXPR</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *hex_lower = <span class="stringliteral">&quot;0123456789abcdef&quot;</span>;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">char</span> *hex_chars = use_uppercase ? hex_upper : hex_lower;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        std::size_t pos = 0;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        std::size_t column = line_size;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keyword">auto</span> inserter = ctx.begin();</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">auto</span> &amp;item : the_range)</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <span class="keyword">auto</span> ch = <span class="keyword">static_cast&lt;</span><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span><span class="keyword">&gt;</span>(item);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            pos++;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            <span class="keywordflow">if</span> (put_newlines &amp;&amp; column &gt;= line_size)</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            {</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                column = put_newline(inserter, pos);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                <span class="comment">// put first byte without delimiter in front of it</span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                *inserter++ = hex_chars[(ch &gt;&gt; 4) &amp; 0x0f];</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                *inserter++ = hex_chars[ch &amp; 0x0f];</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                column += 2;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            }</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            <span class="keywordflow">if</span> (put_delimiters)</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            {</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                *inserter++ = delimiter;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                ++column;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            }</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            *inserter++ = hex_chars[(ch &gt;&gt; 4) &amp; 0x0f];</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            *inserter++ = hex_chars[ch &amp; 0x0f];</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            column += 2;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        }</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="keywordflow">return</span> inserter;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="comment">// put newline(and position header)</span></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// return the next column</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> It&gt;</div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ae001a71b76b4a56f722a7b91c506e9bf">  154</a></span>&#160;    std::size_t <a class="code" href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ae001a71b76b4a56f722a7b91c506e9bf">put_newline</a>(It inserter, std::size_t pos)</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    {</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">#ifdef _WIN32</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        *inserter++ = <span class="charliteral">&#39;\r&#39;</span>;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        *inserter++ = <span class="charliteral">&#39;\n&#39;</span>;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        <span class="keywordflow">if</span> (put_positions)</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        {</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <a class="code" href="namespacefmt_1_1v5.html#a45ad5d5a47de5513643bf7c75b8d7d91">fmt::format_to</a>(inserter, <span class="stringliteral">&quot;{:&lt;04X}: &quot;</span>, pos - 1);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            <span class="keywordflow">return</span> 7;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        }</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="keywordflow">else</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        {</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        }</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    }</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;};</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;} <span class="comment">// namespace fmt</span></div><div class="ttc" id="namespacefmt_1_1v5_1_1internal_html_ae3eb46c4e73a862893cc2f99a58938a4"><div class="ttname"><a href="namespacefmt_1_1v5_1_1internal.html#ae3eb46c4e73a862893cc2f99a58938a4">fmt::v5::internal::begin</a></div><div class="ttdeci">auto begin(const C &amp;c) -&gt; decltype(c.begin())</div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l00251">format.h:251</a></div></div>
<div class="ttc" id="namespacespdlog_html_acd3f4323bb627945b4cecbbbc62770ef"><div class="ttname"><a href="namespacespdlog.html#acd3f4323bb627945b4cecbbbc62770ef">spdlog::to_hex</a></div><div class="ttdeci">details::bytes_range&lt; typename Container::const_iterator &gt; to_hex(const Container &amp;container)</div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00053">bin_to_hex.h:53</a></div></div>
<div class="ttc" id="structfmt_1_1v5_1_1formatter_html"><div class="ttname"><a href="structfmt_1_1v5_1_1formatter.html">fmt::v5::formatter</a></div><div class="ttdef"><b>Definition:</b> <a href="core_8h_source.html#l00491">core.h:491</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1bytes__range_html_aa623616735396b0422737b9b62bdd46e"><div class="ttname"><a href="classspdlog_1_1details_1_1bytes__range.html#aa623616735396b0422737b9b62bdd46e">spdlog::details::bytes_range::bytes_range</a></div><div class="ttdeci">bytes_range(It range_begin, It range_end)</div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00031">bin_to_hex.h:31</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1bytes__range_html_ae46a29852238e3cd2a22b85e2dc1f5d0"><div class="ttname"><a href="classspdlog_1_1details_1_1bytes__range.html#ae46a29852238e3cd2a22b85e2dc1f5d0">spdlog::details::bytes_range::end</a></div><div class="ttdeci">It end() const </div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00041">bin_to_hex.h:41</a></div></div>
<div class="ttc" id="namespacespdlog_html"><div class="ttname"><a href="namespacespdlog.html">spdlog</a></div><div class="ttdef"><b>Definition:</b> <a href="async_8h_source.html#l00027">async.h:27</a></div></div>
<div class="ttc" id="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4_html_ada366ec2d0f00fa94560551fdbbbb640"><div class="ttname"><a href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ada366ec2d0f00fa94560551fdbbbb640">fmt::formatter&lt; spdlog::details::bytes_range&lt; T &gt; &gt;::parse</a></div><div class="ttdeci">auto parse(ParseContext &amp;ctx) -&gt; decltype(ctx.begin())</div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00084">bin_to_hex.h:84</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1bytes__range_html_a45b2db8943b9034c5f56838c482a740a"><div class="ttname"><a href="classspdlog_1_1details_1_1bytes__range.html#a45b2db8943b9034c5f56838c482a740a">spdlog::details::bytes_range::begin</a></div><div class="ttdeci">It begin() const </div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00037">bin_to_hex.h:37</a></div></div>
<div class="ttc" id="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4_html_ae001a71b76b4a56f722a7b91c506e9bf"><div class="ttname"><a href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#ae001a71b76b4a56f722a7b91c506e9bf">fmt::formatter&lt; spdlog::details::bytes_range&lt; T &gt; &gt;::put_newline</a></div><div class="ttdeci">std::size_t put_newline(It inserter, std::size_t pos)</div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00154">bin_to_hex.h:154</a></div></div>
<div class="ttc" id="classspdlog_1_1details_1_1bytes__range_html"><div class="ttname"><a href="classspdlog_1_1details_1_1bytes__range.html">spdlog::details::bytes_range</a></div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00028">bin_to_hex.h:28</a></div></div>
<div class="ttc" id="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4_html_a23665231993cdeb323a86ecb9a7a63a1"><div class="ttname"><a href="structfmt_1_1formatter_3_01spdlog_1_1details_1_1bytes__range_3_01_t_01_4_01_4.html#a23665231993cdeb323a86ecb9a7a63a1">fmt::formatter&lt; spdlog::details::bytes_range&lt; T &gt; &gt;::format</a></div><div class="ttdeci">auto format(const spdlog::details::bytes_range&lt; Container &gt; &amp;the_range, FormatContext &amp;ctx) -&gt; decltype(ctx.out())</div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00112">bin_to_hex.h:112</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_html_a45ad5d5a47de5513643bf7c75b8d7d91"><div class="ttname"><a href="namespacefmt_1_1v5.html#a45ad5d5a47de5513643bf7c75b8d7d91">fmt::v5::format_to</a></div><div class="ttdeci">std::enable_if&lt; is_contiguous&lt; Container &gt;::value &amp;&amp;internal::is_string&lt; S &gt;::value, std::back_insert_iterator&lt; Container &gt; &gt;::type format_to(std::back_insert_iterator&lt; Container &gt; out, const S &amp;format_str, const Args &amp;...args)</div><div class="ttdef"><b>Definition:</b> <a href="core_8h_source.html#l01430">core.h:1430</a></div></div>
<div class="ttc" id="namespacefmt_html"><div class="ttname"><a href="namespacefmt.html">fmt</a></div><div class="ttdef"><b>Definition:</b> <a href="bin__to__hex_8h_source.html#l00069">bin_to_hex.h:69</a></div></div>
<div class="ttc" id="common_8h_html_a8747e6feba8bf2d3f204cb76bfd4607a"><div class="ttname"><a href="common_8h.html#a8747e6feba8bf2d3f204cb76bfd4607a">SPDLOG_CONSTEXPR</a></div><div class="ttdeci">#define SPDLOG_CONSTEXPR</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00036">common.h:36</a></div></div>
<div class="ttc" id="namespacefmt_1_1v5_1_1internal_html_a1f190af8f5561392e03519562384d3b8"><div class="ttname"><a href="namespacefmt_1_1v5_1_1internal.html#a1f190af8f5561392e03519562384d3b8">fmt::v5::internal::end</a></div><div class="ttdeci">auto end(const C &amp;c) -&gt; decltype(c.end())</div><div class="ttdef"><b>Definition:</b> <a href="format_8h_source.html#l00257">format.h:257</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_5f1136fe404e0a548faf586fae339a6a.html">sdk_core</a></li><li class="navelem"><a class="el" href="dir_fef6b6f1028f30fedf17225feaaa02fe.html">include</a></li><li class="navelem"><a class="el" href="dir_7bb3e31efd6b819bbb0704cee4a66d41.html">third_party</a></li><li class="navelem"><a class="el" href="dir_cf58c3a45797022668a1e269b5315a33.html">spdlog</a></li><li class="navelem"><a class="el" href="dir_248a80cf6760c7a1ab13394a1c16f7b2.html">spdlog</a></li><li class="navelem"><a class="el" href="dir_0c3a0641627b76fd80f03d211e44dc98.html">fmt</a></li><li class="navelem"><a class="el" href="bin__to__hex_8h.html">bin_to_hex.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
